import request from '@/utils/request'

export function getStudents(sch_id,data) {
  return request({
    url: `students`,
    method: 'get'
  })
}

/**
 * 条件模型筛选学生
 * @param sch_id
 * @returns {AxiosPromise}
 */
export function getStudentsByCondition(data) {
  return request({
    url: `students/conditions`,
    method: 'post',
    data
  })
}


export function addStudent(data) {
  return request({
    url: 'students',
    method: 'post',
    data
  })
}

export function updateStudent( id,data) {
  return request({
    url: `students`,
    method: 'put',
    data
  })
}

export function deleteStudent(data) {
  return request({
    url: `students`,
    method: 'delete',
    data
  })
}

export function getParents(bindcode) {
  return request({
    url: `parents/${bindcode}`,
    method: 'get'
  })
}

export function addParent(data) {
  return request({
    url: 'parents',
    method: 'post',
    data
  })
}

export function updateParent( id,data) {
  return request({
    url: `parents`,
    method: 'put',
    data
  })
}

export function deleteParent(data) {
  return request({
    url: `parents`,
    method: 'delete',
    data
  })
}
export function deleteparentdata(data) {
  return request({
    url: `deleteparentdata`,
    method: 'post',
    data
  })
}



